package com.codes.core.ceshi.xiancheng;
/**
 * @Description 
 * @Date 2020/8/22 18:18
 * @Created  peanut
 */
public class TestMaiPiao {


    public static void main(String[] args) throws InterruptedException {
        // 初始时间
        final long start = System.currentTimeMillis();
        Thread daemon = new Thread(() ->
                System.out.println("所有线程执行耗时(ms)：" + (System.currentTimeMillis() - start)));

        daemon.setDaemon(true);
        daemon.start();


        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                //do something
                long count = 0;
                for (int j = 0; j < 90000000; j++){
                    count+=j;
                }
                System.out.println("count="+count);
            }).start();
        }

    }

}